var judge = ctx + "gaoxin/system/twfJudge";
$(function () {
    let wfId = $('#wfId').val();
    //回访记录列表
    var options = {
        url: judge + '/judgeListJson/' + wfId,
        sortName: "pkid",
        sortOrder: "desc",
        uniqueId: "pkId",
        showColumns: false,                  //是否显示所有的列（选择显示的列）
        showRefresh: false,
        showSearch: false,
        showToggle: false,
        fixedColumns: true,
        fixedNumber: 1,
        fixedRightNumber: 1,
        columns: [{
            field: 'pkId',
            title: 'id',
            visible: false
        },
            {field:'PkId',title:'用户编号',hidden:true,visible: false},
            {field:'WfId',title:'WfId',hidden:true,visible: false},
            {field:'JudgeIP',title:'评价来源地址',align:'center',sortable:true},
            {field:'visitTime',title:'评价时间',align:'left',halign:'center',width:80, sortable:true},
            {field:'VisitPerson',title:'被访对象',align:'center',sortable:true},
            {field:'VstDeptName',title:'回访单位',align:'center'},
            {field:'VstUserName',title:'回访人',align:'left',halign:'center'},
            {field:'JudgeN',title:'满意度',align:'center',sortable:true},
            {field:'VstDesc',title:'回访意见',align:'left',width:110, halign:'center'},
            {
                field : 'wfId',
                title: '操作',
                width: 60,
                align: 'center',
                valign: 'middle',
                formatter: actionFormatter
            }]
    };
    $.table.init(options);
});

function actionFormatter(value, row, index) {
    var result = "";
    result += "<a href='javascript:;' class='btn btn-xs blue' onclick=\"detail('"+row.PkId+"')\" title='详情'><span>详情</span></a>";
    return result;
}

function detail(pkId){
    var url = judge + "/judgeDetail/"+pkId;
    $.modal.openDialog('回访记录详情', url,'60%','84%');
}